﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Reviewer.Entities
{
    [DataContract(Namespace = "Reviewer.Entities")]
    public sealed class GameScreenshotSearchResult : GameScreenshot, IExtensibleDataObject
    {
        public static bool operator ==(GameScreenshotSearchResult item1, GameScreenshotSearchResult item2)
        {
            // If both are null, or both are same instance, return true.
            if (System.Object.ReferenceEquals(item1, item2))
            {
                return true;
            }

            // If one is null, but not both, return false.
            if (((object)item1 == null) || ((object)item2 == null))
            {
                return false;
            }

            return item1.Equals(item2);
        }

        public static bool operator !=(GameScreenshotSearchResult item1, GameScreenshotSearchResult item2)
        {
            return !(item1 == item2);
        }

        [DataMember()]
        public string GameTitle { get; set; }
        [DataMember()]
        public int GameFormat { get; set; }
        [DataMember]
        public string GameFormatName { get; set; }
        [DataMember]
        public int GameGenre { get; set; }
        [DataMember]
        public string GameGenreName { get; set; }
        [DataMember]
        public int ScreenshotCount { get; set; }

        public override bool Equals(object obj)
        {
            GameScreenshotSearchResult second = (GameScreenshotSearchResult)obj;
            if (second != null)
            {
                return this.GameTitle.Equals(second.GameTitle)
                && this.GameFormat.Equals(second.GameFormat)
                && this.GameFormatName.Equals(second.GameFormatName)
                && this.GameGenre.Equals(second.GameGenreName)
                && base.Equals(obj);
            }

            return false;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        #region IExtensibleDataObject Members
        ExtensionDataObject IExtensibleDataObject.ExtensionData { get; set; }
        #endregion
    }
}
